//
//  Header.h
//  AnXin100
//
//  Created by 天质弘耕 on 2018/9/27.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import <UIKit/UIKit.h>
#ifndef Header_h
#define Header_h

#define AppID       @"1397337159"
#define AppStore    [NSString stringWithFormat:@"itms-apps://itunes.apple.com/cn/app/id%@?mt=8", AppID]

/**隐藏键盘*/
#define KeyboardHide    [[[UIApplication sharedApplication] keyWindow] endEditing:YES]


/**主窗口*/
#define KeyWindow   [UIApplication sharedApplication].keyWindow


#pragma mark - 尺寸大小

#define Wi          [UIScreen mainScreen].bounds.size.width
#define Hi          [UIScreen mainScreen].bounds.size.height 
//状态栏的高度
#define Hs          [[UIApplication sharedApplication] statusBarFrame].size.height
/** 导航条的高度 */
#define Hn          (Hs+44)
/** 下面的高度 */
#define Htb         (49 + Hb)
#define Hb          (IsPhoneX ? 34 : 0)
#define MyTableViewHeight (Hi-Hn-44)
#define TableViewHeight (Hi-Hn)

//高度等于480 320
#define IsPhone4    ([UIScreen mainScreen].bounds.size.height == 480)
//高度等于568 320
#define IsPhoneSE   ([UIScreen mainScreen].bounds.size.height == 568)
//高度等于667 375
#define IsPhone8    ([UIScreen mainScreen].bounds.size.height == 667)
//高度大于736 414
#define IsPhone8P   ([UIScreen mainScreen].bounds.size.height == 736)
//高度大于812 375
#define IsPhoneX    (Hs > 20)

#define IsPad       (Wi/Hi > 0.66)




#pragma mark - 颜色


#define RGBA(r,g,b,a)   [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define RGB(r,g,b)      RGBA(r,g,b,1)
#define White(w)        RGB(w,w,w)

#define kRand(x)        arc4random_uniform(x)
#define kC_Random       RGB(kRand(256),kRand(256),kRand(256))

#define kC_Main         RGB(82, 187, 181)

#define kCB_Main        RGB(82, 187, 181)
#define kCB_Orange      RGB(249, 126, 35)

#define kCT_Main        RGB(82, 187, 181)



#pragma mark - 路径

#define kDocPath       NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]
#define kLibCachesPath NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0]



#pragma mark - typedef
typedef void(^BtnClickBlock)(UIButton *btn);
typedef void(^ViewBlock)(UIView *view);
typedef void(^BaseBlock)(void);
typedef void(^IndexBlock)(NSInteger index);

//打印log
#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#else
#define DLog(...)
#endif

#define DLogFunc    DLog(@"-%s-",__func__)


#define DFWeakSelf      __weak typeof(self) weakSelf = self

#define DFStrongSelf    typeof(weakSelf) strongSelf = weakSelf

#endif /* Header_h */

